<template>
  <div class="app">
    <input type="text" v-focus>
    <hr>
    <h2>自定义指令的参数和修饰符</h2>
    <div v-price>111</div>
    <div v-price="'$'">123</div>
    <hr>
    <h2>自定义指令时间格式化</h2>
    <div v-time>{{ time }}</div>
    <div v-time=" 'YYYY/MM/DD'">1498478736</div>
  </div>
</template>
<!-- <script>
export default {
  directives: {
    focus: {
      mounted(el) {
        el?.focus()
      }
    }
  }
}
</script > -->
<script setup>
// 局部注册
// const vFocus = {
//   mounted(el) {
//     el?.focus()
//   }
// }
const time = 1234567893
</script>
<style scoped lang="less"></style>